/**
 *
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 *
 */

package org.baatar.opt.genetic.impl.prmopt;

import java.io.Serializable;

/**
 *
 * Stores information about parameters that will be encoded in chromosomes.
 *
 */
public class ParamInfo implements Serializable, Cloneable {
    /**
     * 
     */
    private static final long serialVersionUID = -4284564211118314663L;

    private String paramName = null;
    private double minValue = -1000.0;
    private double maxValue = 1000.0;
    private int bitSize = 16;

    public ParamInfo(String paramName,
                        double minValue,
                        double maxValue,
                        int bitSize) {
        this.paramName = paramName;
        this.minValue = minValue;
        this.maxValue = maxValue;
        this.bitSize = bitSize;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
    	ParamInfo paramInfo = (ParamInfo) super.clone();
    	return paramInfo;
    }

    /**
     * @return the paramName
     */
    public String getParamName() {
        return paramName;
    }

    /**
     * @return the minValue
     */
    public double getMinValue() {
        return minValue;
    }

    /**
     * @return the maxValue
     */
    public double getMaxValue() {
        return maxValue;
    }

    /**
     * @return the bitSize
     */
    public int getBitSize() {
        return bitSize;
    }

    @Override
    public String toString() {
    	return paramName + " " + 
    			minValue + "/" + 
    			maxValue + "/" + 
    			bitSize + " (min/max/bit)";
    }

    /**
     * @param paramName the paramName to set
     */
    public void setParamName(String paramName) {
        this.paramName = paramName;
    }

    /**
     * @param minValue the minValue to set
     */
    public void setMinValue(double minValue) {
        this.minValue = minValue;
    }

    /**
     * @param maxValue the maxValue to set
     */
    public void setMaxValue(double maxValue) {
        this.maxValue = maxValue;
    }

    /**
     * @param bitSize the bitSize to set
     */
    public void setBitSize(int bitSize) {
        this.bitSize = bitSize;
    }
}
